package com.xiaohudie.abnormal;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Author xiao hu die
 * @Date 2022/4/8 17:52
 * @Version 1.0
 */
//@ControllerAdvice
public class MyExceptionHandler {
   @ExceptionHandler(value = Exception.class)
    public String exceptionHandler(Exception e){
       System.out.println("出现异常！！！原因是:"+ e);
       return e.getMessage();
   }
}
